package simple11.facade;


import simple11.bag.Bag;
import simple11.bag.CheckedBagDecorator;
import simple11.bag.ReinforceBagDecorator;
import simple11.bag.SpeedBagDecorator;
import simple11.factory.AppleFactory;
import simple11.factory.FruitFactory;

/**
 * 包装服务
 */
public class PackService {
    /**
     * 水果打包,:防伪/加固/加急
     */
    public void  doPack(){
        FruitFactory fruitFactory = new AppleFactory();
//      得到包装
        Bag bag =((AppleFactory) fruitFactory).getBag();
//        添加装饰
        bag = new CheckedBagDecorator(bag);
        bag = new ReinforceBagDecorator(bag);
        bag = new SpeedBagDecorator(bag);
        bag.getBag();

    }
    public void  doOther(){
        System.out.println("其它服务");
    }
}
